Component({
  mixins: [],
  data: {
    currentSort: 1,
    showType: 'grid'
  },
  props: {
    showTypeSwitch: true,
    goodsList: [],
    isFixed: false,
    emptyTip: '',
    isLoading: false
  },
  didMount() { },
  didUpdate() { },
  didUnmount() { },
  methods: {
    changeType() {
      this.setData({
        showType: this.data.showType === 'grid' ? 'list' : 'grid'
      })
    },
    changeSortType(e) {
      const index = e.currentTarget.dataset.index;
      this.setData({
        currentSort: index == 2 && this.data.currentSort == 2 ? 3 : index
      });
      this.props.onSortList(this.data.currentSort);
    }
  },
});
